[PATCH] Fix invalid pointer return with QGridLayout::itemAt(-1)
authorZhang Yu <zhangyub@uniontech.com>
Mon, 22 Feb 2021 01:25:01 +0000 (09:25 +0800)
committerDmitry Shachnev <mitya57@debian.org>
Fri, 2 Jul 2021 15:58:04 +0000 (16:58 +0100)
commitb0feee5987a9a938e7e6dac4a222877b3fd98ac7
treeb204245568b5a2d7ebc8a98933a601dc16a7db5e
parent00f5051a496125861f4d6a0a307470d6d4506686
[PATCH] Fix invalid pointer return with QGridLayout::itemAt(-1)

QGridLayout::takeAt() and QLayoutItem *itemAt() only check the upper bound.
If the index < 0, these function will return invalid pointer.

Fixes: QTBUG-91261
Pick-to: 5.15 6.0 6.1
Change-Id: Idfb9fb6228b9707f817353b04974da16205a835c
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Gbp-Pq: Name fix-invalid-pointer-return-with-QGridLayout.diff
src/widgets/kernel/qgridlayout.cpp
tests/auto/widgets/kernel/qgridlayout/tst_qgridlayout.cpp